package com.ershu.user.service;

import com.ershu.role.domain.Role;
import com.ershu.role.service.RoleService;
import com.ershu.user.dao.UserDao;
import com.ershu.user.domain.User;

public class UserService {
	private UserDao userDao = new UserDao();
	private RoleService roleService = new RoleService();
	
	/**
	 * 
	 * @param id
	 * @return user
	 * @author HaiShin
	 * 通过user的id来查找
	 */
	public User findById(String id){
		User user = userDao.findById(id);
		Role role = roleService.findById(user.getRole().getId());
		user.setRole(role);
		return user;
	}
}
